#ifndef _FILE_WRITER_H
#define _FILE_WRITER_H

#ifdef _WIN32
#pragma once
#endif

/**
 * Writes binary data to a specified file.
 *
 * 29/02/2012 - Steven Hartin - Created the class structure, implemented from 
 *                              UML
 */

#include <iostream>
#include <fstream>
#include <string>

using std::ofstream;
using std::string;

class CFileWriter
{
public:
    CFileWriter(const string &szFilePath);
    ~CFileWriter();

    void writeShort(short int nValue);
    void writeLong(long int nValue);
    void writeBool(bool nValue);
    void writeString(const string &szValue);
    void writeString(char *szValue);
    void writeChar(char chValue);
    void writeFloat(float fValue);
    void writeDouble(double dValue);

private:
    string m_szFilePath;
    ofstream m_FileStream;

    void _openFile();
    void _closeFile();
};

#endif